package com.gsit.job;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.gsit.job.config.AppConfig;
import com.gsit.job.domain.SearchType;
import com.gsit.job.flows.ExpSearchFlow;
import com.gsit.job.flows.JobService;
import com.gsit.job.flows.KeywordsSearchFlow;

public class MainSearchApp {
	private static ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		MainSearchApp app = new MainSearchApp();
		//app.loadSearchCriteriaToDB();
		//app.runSearchFlow();
		app.runKeyWorkSearchFlow();
	
	
	}
	
	private void runJobService(){
		 JobService jobService = context.getBean(JobService.class);
		 jobService.execute(null,false);
	}
	private void runSearchFlow(){
		ExpSearchFlow flow = context.getBean(ExpSearchFlow.class);
		flow.execute(SearchType.EXEP_WOMEN,false);
		
	}
	
	private void runKeyWorkSearchFlow(){
		KeywordsSearchFlow flow = context.getBean(KeywordsSearchFlow.class);
		flow.execute(SearchType.KEYWORD,false);
		
	}
	
	private void runExpKeyWorkSearchFlow(){
		KeywordsSearchFlow flow = context.getBean(KeywordsSearchFlow.class);
		flow.execute(SearchType.EXEP_KEYWORD,false);
		
	}

}
